--大地礼赞
local dadilizan = fk.CreateSkill {
    name = "mcdh_dadilizan",
}

local U = require "packages/utility/utility"
local lib = require "packages/mcdh/lib"

dadilizan:addEffect(fk.Damaged,{
    can_trigger =function(self, event, target, player, data)
        return player:hasSkill(self)  and target == player and data.from  and not data.from:isKongcheng()
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        local c = room:askForCardChosen(player, data.from, "h", self.name)
        room:obtainCard(player.id, c, false, fk.ReasonPrey)
        if #player:getCardIds("h") <= #data.from:getCardIds("h") then
            local  cards =room:getCardsFromPileByRule("jink", 1, "discardPile")
            if #cards > 0 then
                player.room:obtainCard(player, cards[1], true, fk.ReasonPrey)
            end
        end
    end
})

Fk:loadTranslationTable {
    ["mcdh_dadilizan"] = "大地礼赞",
    [":mcdh_dadilizan"] = "当你受到伤害后，你可以获得伤害来源一张手牌，然后若其手牌数不小于你，你从弃牌堆获得一张【闪】。",
}

return dadilizan